import 'package:fluttertoast/fluttertoast.dart';
import 'package:url_launcher/url_launcher.dart';

class ToGP{
  //打开google应用市场
  launchUrl(String id) async {
    String url = 'https://play.google.com/store/apps/details?id=$id';
    print('url === >>>>  $url');
    if (await canLaunch(url)) {
      await (launch(url));
    } else {
      Fluttertoast.showToast(
        msg: 'Open fail',
        toastLength: Toast.LENGTH_SHORT,
        gravity: ToastGravity.CENTER,
      );
    }
  }
}